// 地址类型选项
export const addressTypes = [
	{ value: null, label: '不选择' },
	{ value: 0, label: '家' },
	{ value: 1, label: '学校' },
	{ value: 2, label: '公司' }
]

// 地址类型显示转换
export const addressTypeShow = (addressType) => {
	switch (addressType) {
		case "HOME":
			return "家"
		case "SCHOOL":
			return "学校"
		case "FIRM":
			return "公司"
		default:
			return "不选择"
	}
}

// 地址类型值转换
export const addressTypeValue = (addressType) => {
	switch (addressType) {
		case "HOME":
			return 0
		case "SCHOOL":
			return 1
		case "FIRM":
			return 2
		default:
			return null
	}
}

// 获取地址类型标签
export const getAddressTypeLabel = (type) => {
	const typeObj = addressTypes.find(item => item.value === type)
	return typeObj ? typeObj.label : '不选择'
} 